/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-03-10     CGY       the first version
 */
#ifndef APPLICATIONS_HEADER_FILE_MOTOR_CTRL_H_
#define APPLICATIONS_HEADER_FILE_MOTOR_CTRL_H_

#include <remote_ctrl.h>
#include <stdint.h>

#define FINAL_P             0.35f        //电机输出量比例
//#define motor_hover         450         //电机悬停油门量,*************换电池时一定一定要改一下这里
#define motor_hover         210     //气球悬停量

#define lazy_speed          100

typedef enum
{
    Moter_lock,
    Moter_lazy,
    Moter_obey,
    Motor_ESCCali
}MTState;

enum
{
    Motor_m1 = 0,
    Motor_m2 ,
    Motor_m3 ,
    Motor_m4 ,
    Motor_m5 ,
    Motor_m6 ,
    Motor_m7 ,
    Motor_m8 ,
    Motor_Num
};

typedef struct
{
    uint16_t    base_out;
    int16_t     Motor[Motor_Num];

    void (*stateUpdate)(MTState state);
}MT_HandleTypedef;
extern MT_HandleTypedef MT_Handle;

#endif /* APPLICATIONS_HEADER_FILE_MOTOR_CTRL_H_ */

